from Products.Five import zcml
from Products.Five import fiveconfigure
from Testing import ZopeTestCase as ztc
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import onsetup

ztc.installProduct('Quills')
ztc.installProduct('Poi')
ztc.installProduct('eXtremeManagement')
ztc.installProduct('Clouseau')

@onsetup
def setup_modulus_policy():
    """Set up the additional products required for the modulus site policy"""

    #Load the ZCML configuration for the modulus.policy package
    fiveconfigure.debug_mode = True
    import modulus.policy
    zcml.load_config('configure.zcml', modulus.policy)
    fiveconfigure.debug_mode = False

    #have the testing framework load the product
    ztc.installPackage('modulus.policy')
    ztc.installPackage('plone.openid')
    ztc.installPackage('plone.app.openid')
    ztc.installPackage('plone.app.iterate')
    
setup_modulus_policy()
ptc.setupPloneSite(products=['modulus.policy',
                             'Quills',
                             'Poi',
                             'eXtremeManagement'
                             'Clouseau'])

class ModulusPolicyTestCase(ptc.PloneTestCase):
    """This is the base class for all tests in this package.
    Additionally, common utitlities and setup code goes here"""
